home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1998 July / EnigmA AMIGA RUN 29 (1998)(G.R. Edizioni)(IT)[!][issue 1998-07 & 08].iso / recent / iib122.lha / IIB / Threads / Additional / IARexx.lha / SpiralPathArth.irx < prev    next >
Text File  |  1997-09-20  |  1KB  |  65 lines

  1. /*              */
  2. address 'Imagine.1'
  3.  
  4. displayrexxptr on
  5.  
  6. call addlib('rexxmathlib.library',0,-30,0)
  7. /* call addlib('rexxreqtools.library',0,-30,0) <---relevant later? */
  8.  
  9. /* static constant */
  10. pi = 3.14159
  11.  
  12.  
  13. /* user variables */
  14. numturn = 3     /* Number of 360 deg. turns for spiral */
  15. rdius = 25     /* radius of spiral */
  16. turnZ = 150      /* vertical space between loops/turn (space between loops) */
  17.  
  18. /* precalcs */
  19. qturnZ = turnZ / 4 /* increment for each axis position */
  20. xrot = ATAN( qturnZ * 0.75 / rdius ) * 180 / pi  /* figure angle-up of axis */
  21.  
  22.  
  23. do i=0 to (4 * numturn)
  24.  
  25.   addaxis
  26.   pick
  27.  
  28.   attrib.objectname = 'SP.'i
  29.  
  30.   x = rdius * cos(pi * i / 2)
  31.   y = rdius * sin(pi * i / 2)
  32.   z= qturnz * i
  33.   angle = 90 * i
  34.  
  35.   TRANSFORM_POSITION x y z
  36.   TRANSFORM_ALIGNMENT xrot 0 angle
  37.  
  38.   setattributes objectname
  39.  
  40. end
  41. /* This is irrelevant since the "makepath"
  42.    uses the first axis as the path:
  43. addaxis
  44. */
  45. unpick all
  46. groupmode
  47.  
  48. /* make the path */
  49.  
  50. multipickon
  51. do i = 0 to (4 * numturn)
  52.    pick 'SP.'i
  53. end
  54. multipickoff
  55.  
  56. makepath
  57.  
  58. /* reset origin axis to center and correct alignment */
  59. TRANSFORMA_POSITION 0 0 0
  60. TRANSFORMA_ALIGNMENT 0 0 0
  61.  
  62.  
  63. displayrexxptr off
  64. exit
  65.